package top.air.backend.task.model.req;

import java.io.Serial;
import java.time.*;

import jakarta.validation.constraints.*;

import lombok.Data;

import io.swagger.v3.oas.annotations.media.Schema;

import org.hibernate.validator.constraints.Length;

import top.continew.starter.extension.crud.model.req.BaseReq;

/**
 * 创建或修改设备资源参数
 *
 * @author 文艺倾年
 * @since 2025/03/25 16:25
 */
@Data
@Schema(description = "创建或修改设备资源参数")
public class DeviceInfoReq extends BaseReq {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 设备名称
     */
    @Schema(description = "设备名称")
    @NotBlank(message = "设备名称不能为空")
    @Length(max = 255, message = "设备名称长度不能超过 {max} 个字符")
    private String name;

    /**
     * 设备类别
     */
    @Schema(description = "设备类别")
    @NotNull(message = "设备类别不能为空")
    private Integer category;

    /**
     * 管理编号
     */
    @Schema(description = "管理编号")
    @NotBlank(message = "管理编号不能为空")
    @Length(max = 100, message = "管理编号长度不能超过 {max} 个字符")
    private String managementNumber;

    /**
     * 型号
     */
    @Schema(description = "型号")
    @NotBlank(message = "型号不能为空")
    @Length(max = 100, message = "型号长度不能超过 {max} 个字符")
    private String modelNumber;

    /**
     * 出厂编号
     */
    @Schema(description = "出厂编号")
    @NotBlank(message = "出厂编号不能为空")
    @Length(max = 100, message = "出厂编号长度不能超过 {max} 个字符")
    private String factoryNumber;

    /**
     * 计量单位
     */
    @Schema(description = "计量单位")
    @NotNull(message = "计量单位不能为空")
    private Integer measureUnit;

    /**
     * 数量
     */
    @Schema(description = "数量")
    @NotNull(message = "数量不能为空")
    private Integer count;

    /**
     * 状态
     */
    @Schema(description = "状态")
    @NotBlank(message = "状态不能为空")
    @Length(max = 255, message = "状态长度不能超过 {max} 个字符")
    private String status;

    /**
     * 放置位置
     */
    @Schema(description = "放置位置")
    @NotBlank(message = "放置位置不能为空")
    @Length(max = 255, message = "放置位置长度不能超过 {max} 个字符")
    private String location;

    /**
     * 购置来源
     */
    @Schema(description = "购置来源")
    @NotBlank(message = "购置来源不能为空")
    @Length(max = 255, message = "购置来源长度不能超过 {max} 个字符")
    private String source;

    /**
     * 购置时间
     */
    @Schema(description = "购置时间")
    @NotNull(message = "购置时间不能为空")
    private LocalDateTime buyDate;

    /**
     * 生产厂家
     */
    @Schema(description = "生产厂家")
    @NotBlank(message = "生产厂家不能为空")
    @Length(max = 255, message = "生产厂家长度不能超过 {max} 个字符")
    private String manufacturer;

    /**
     * 购置金额
     */
    @Schema(description = "购置金额")
    @NotNull(message = "购置金额不能为空")
    private Float purchaseAmount;

    /**
     * 备注
     */
    @Schema(description = "备注")
    @Length(max = 100, message = "备注长度不能超过 {max} 个字符")
    private String mark;

    /**
     * 物资去向
     */
    @Schema(description = "物资去向")
    private Integer destination;
}
